﻿using System.Diagnostics;

namespace TDDLab.ZombieMovieCatalog
{
    public class Logger : ILogger
    {
        private readonly string _source = "Zombie Movie Catalog";
        private readonly string _logName = "Application";

        public Logger()
        {
            if (!EventLog.SourceExists(_source))
                EventLog.CreateEventSource(_source, _logName);
        }


        public void WriteToLog(string message)
        {
            EventLog.WriteEntry(_source, message, EventLogEntryType.Error);
        }
    }
}
